using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableEXWarehouseType
	{
		public const string Table = "EXWarehouseType";
		public const string EXWarehouseTypeID = "EXWarehouseTypeID";
		public const string EXWarehouseTypeName = "EXWarehouseTypeName";
	}
	
	[Serializable]
	public class BaseEXWarehouseType
		: IDbSessionEntity, IJsonClass
	{
		int m_EXWarehouseTypeID;
		/// <summary>
        /// 
        /// </summary>
        public int EXWarehouseTypeID
        {
            get { return m_EXWarehouseTypeID; }
            set { m_EXWarehouseTypeID = value; }
        }
		
		string m_EXWarehouseTypeName;
		/// <summary>
        /// 
        /// </summary>
        public string EXWarehouseTypeName
        {
            get { return m_EXWarehouseTypeName; }
            set { m_EXWarehouseTypeName = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_EXWarehouseTypeID = reader[TableEXWarehouseType.EXWarehouseTypeID];
            m_EXWarehouseTypeName = reader[TableEXWarehouseType.EXWarehouseTypeName];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableEXWarehouseType.EXWarehouseTypeID, PrimaryKeyType.Identity, EXWarehouseTypeID);
			writer[TableEXWarehouseType.EXWarehouseTypeName] = EXWarehouseTypeName;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_EXWarehouseTypeID = idd;
        }
		
		public string TableName
        {
            get { return TableEXWarehouseType.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_EXWarehouseTypeID = hashToRead["EXWarehouseTypeID"];
			 
             m_EXWarehouseTypeName = hashToRead["EXWarehouseTypeName"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["EXWarehouseTypeID"] = EXWarehouseTypeID;
			 
            hashToFill["EXWarehouseTypeName"] = EXWarehouseTypeName;
			 
        }

        #endregion
		
	}
}
